#include <stdio.h>

/*
 * 识别条件运算符
 */

int main()
{
	int a, b;

	a = (a > 0) ? 1 : -1;

	if (b > 0)
		b = 1;
	else
		b = -1;

	return a + b;
}

#if 0

/*
 * intel
 */
0000000000001129 <main>:
    1129:	f3 0f 1e fa          	endbr64 
    112d:	55                   	push   %rbp
    112e:	48 89 e5             	mov    %rsp,%rbp
    1131:	83 7d fc 00          	cmpl   $0x0,-0x4(%rbp)	// (rbp-0x4)-0x0
    1135:	7e 07                	jle    113e <main+0x15>	// <=
    1137:	b8 01 00 00 00       	mov    $0x1,%eax	// eax=0x1
    113c:	eb 05                	jmp    1143 <main+0x1a>
    113e:	b8 ff ff ff ff       	mov    $0xffffffff,%eax	// eax=0xffffffff
    1143:	89 45 fc             	mov    %eax,-0x4(%rbp)	// (rbp-0x4)=eax
    1146:	83 7d f8 00          	cmpl   $0x0,-0x8(%rbp)	// (rbp-0x8)-0x0
    114a:	7e 09                	jle    1155 <main+0x2c>	// <=
    114c:	c7 45 f8 01 00 00 00 	movl   $0x1,-0x8(%rbp)	// (rbp-0x8)=0x1
    1153:	eb 07                	jmp    115c <main+0x33>	// 
    1155:	c7 45 f8 ff ff ff ff 	movl   $0xffffffff,-0x8(%rbp)	// (rbp-0x8)=0xffffffff
    115c:	8b 55 fc             	mov    -0x4(%rbp),%edx	// edx=(rbp-0x4)
    115f:	8b 45 f8             	mov    -0x8(%rbp),%eax	// eax=(rbp-0x8)
    1162:	01 d0                	add    %edx,%eax	// eax+=edx
    1164:	5d                   	pop    %rbp
    1165:	c3                   	retq   
    1166:	66 2e 0f 1f 84 00 00 	nopw   %cs:0x0(%rax,%rax,1)
    116d:	00 00 00 

/*
 * arm
 */
000000000040051c <main>:
  40051c:	d10043ff 	sub	sp, sp, #0x10
  400520:	b9400be0 	ldr	w0, [sp, #8]
  400524:	7100001f 	cmp	w0, #0x0		// w0-0x0
  400528:	5400006d 	b.le	400534 <main+0x18>
  40052c:	52800020 	mov	w0, #0x1                   	// #1
  400530:	14000002 	b	400538 <main+0x1c>
  400534:	12800000 	mov	w0, #0xffffffff            	// #-1
  400538:	b9000be0 	str	w0, [sp, #8]		// [sp+8]=w0
  40053c:	b9400fe0 	ldr	w0, [sp, #12]		// w0=[sp+12]
  400540:	7100001f 	cmp	w0, #0x0		// w0-0x0
  400544:	5400008d 	b.le	400554 <main+0x38>
  400548:	52800020 	mov	w0, #0x1                   	// #1
  40054c:	b9000fe0 	str	w0, [sp, #12]		// [sp+12]=w0
  400550:	14000003 	b	40055c <main+0x40>
  400554:	12800000 	mov	w0, #0xffffffff            	// #-1
  400558:	b9000fe0 	str	w0, [sp, #12]		// [sp+12]=w0
  40055c:	b9400be1 	ldr	w1, [sp, #8]		// w1=[sp+8]
  400560:	b9400fe0 	ldr	w0, [sp, #12]		// w0=[sp+12]
  400564:	0b000020 	add	w0, w1, w0		// w0=w1+w0
  400568:	910043ff 	add	sp, sp, #0x10
  40056c:	d65f03c0 	ret

#endif
